package wiki.generic.iotests;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

import wiki.generic.contents.Content;
import wiki.generic.io.ContentsWriter;

/**
 * 
 * @author <p><strong>JwTeam</strong></p> 
 *
 */
public class ConcreteContentsWriter implements ContentsWriter {

	@Override
	public void writeContents(List<Content> contentList, String destinationPath) {
		File file=new File(destinationPath); 
		try {
			BufferedWriter writer=new BufferedWriter(new FileWriter(file));
			for (int i = 0; i < contentList.size(); i++) {
				writer.write(contentList.get(i).toString()+"\n");
			}	
		writer.close();
	
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
